// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdCurrency
 */
public class AdCurrencyDaoImpl
    extends org.tinaelle.server.domain.AdCurrencyDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdCurrencyDao#toAdCurrencyDTO(org.tinaelle.server.domain.AdCurrency)
     */
    public org.tinaelle.common.dto.AdCurrencyDTO toAdCurrencyDTO(final org.tinaelle.server.domain.AdCurrency entity)
    {
        return super.toAdCurrencyDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdCurrency loadAdCurrencyFromAdCurrencyDTO(org.tinaelle.common.dto.AdCurrencyDTO adCurrencyDTO)
    {
        org.tinaelle.server.domain.AdCurrency adCurrency = this.load(adCurrencyDTO.getAdCurrencyId());
        if (adCurrency == null)
        {
            adCurrency = org.tinaelle.server.domain.AdCurrency.Factory.newInstance();
        }
        return adCurrency;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdCurrencyDao#adCurrencyDTOToEntity(org.tinaelle.common.dto.AdCurrencyDTO)
     */
    public org.tinaelle.server.domain.AdCurrency adCurrencyDTOToEntity(org.tinaelle.common.dto.AdCurrencyDTO adCurrencyDTO)
    {
        org.tinaelle.server.domain.AdCurrency entity = this.loadAdCurrencyFromAdCurrencyDTO(adCurrencyDTO);
        this.adCurrencyDTOToEntity(adCurrencyDTO, entity, true);
        return entity;
    }
}